<!--添加链接-->
<div class="module_add_uri">
    <h1>添加链接</h1>
    <div class="attrs">
        <form action="./add" method="post">
            <div>
                分辨率：
                <input type="radio" name="resolution" value="1" id="1080p"><label for="1080p">1080p</label>
                <input type="radio" name="resolution" value="2" id="720p"><label for="720p">720p</label>
                <input type="radio" name="resolution" value="3" id="480p"><label for="480p">480p</label>
            </div>
            <div id="download">
                下载：
                <input type="radio" name="download" value="free_genuine_download" id="free_genuine_download"><label for="free_genuine_download">免费正版下载</label>
                <input type="radio" name="download" value="chargeable_genuine_download" id="chargeable_genuine_download"><label for="chargeable_genuine_download">收费正版下载</label>
                <input type="radio" name="download" value="free_direct_download" id="free_direct_download"><label for="free_direct_download">免费下载</label>
            </div>
<?php
foreach($v['providers'] as $k=>$one) {
    if(($one['is_free'] == 1) && ($one['is_genuine'] == 1)) {
        $download['free_genuine_download'][$one['id']] = $one['name'];
    }
    if(($one['is_free'] == 0) && ($one['is_genuine'] == 1)) {
        $download['chargeable_genuine_download'][$one['id']] = $one['name'];
    }
    if(($one['is_free'] == 1) && ($one['is_direct_download'] == 1)) {
        $download['free_direct_download'][$one['id']] = $one['name'];
    }
}
foreach($download as $k=>$one) {
    echo '<div class="providers" id="' . $k . '_providers">提供商：' . "\n";
    foreach($one as $provider_id=>$provider_name) {
    echo '<input type="radio"';
    if(in_array($provider_name, array('BT', 'PT'))) {
        echo ' data-uri="torrent_file_container"';
    } else {
        echo ' data-uri="uri_container"';
    }
    echo ' name="provider_id" value="' . $provider_id . '" id="provider_id_' . $provider_id . '"><label for="provider_id_' . $provider_id . '">' . $provider_name . '</label>';
    }
    echo '</div>' . "\n";
}
;?>
<script type="text/javascript">
attachEventAddUriChooseDownload();
</script>
<div class="uri_container" id="uri_container">
    <label for="uri">链接：</label><input id="uri" type="text" size="50" maxlength="200" name="uri" />
</div>
<div class="uri_container" id="torrent_file_container">
    上传种子文件：<input id="torrent_filename" type="text" name="torrent_filename" />
    <?php
    $callback = <<<END
window.parent.document.getElementById('torrent_filename').value = Lib.getParameterByName('filename');
END;
require_once dirname(__FILE__) . '/../conf.tpl';
?>
    <iframe height="30" width="400" src="<?php echo $conf['uri']['usercontent_upload'] . '?redirect_uri=' . rawurlencode($conf['uri']['xd_receiver']) .'&callback=' . rawurlencode($callback);?>" frameBorder="0"></iframe>
    <div>
    <label for="desc">种子说明：</label><input id="desc" type="text" size="20" maxlength="50" name="desc" />
    </div>
</div>
<script>
attachEventAddUriChooseProvider();
</script>
            <input type="submit" />
        </form>
    </div>
</div>
